<?php
$test_series = $_GET['test_series'];

include 'db_connection.php';
include 'navigation.php';

$query = "select Type from TYPE";
$QueryResult = @mysqli_query($DBConnect, $query) or die("<p>Unable to execute query.</p>");

$num_rows = mysqli_num_rows($QueryResult);

$i=0;
while ($row = mysqli_fetch_assoc($QueryResult)) { 
	$type[$i] = $row['Type'];
	$i++;
}

?>

<html>
<body>

<form action="upload_file.php" method="post" enctype="multipart/form-data">
Test Series: <?php echo $test_series;?><br/>
<input type="hidden" name="test_series" value=<?php echo $test_series;?> />
Test Type: <select name="test_type">

<?php 
for($i=0; $i<$num_rows; $i++){
	echo "<option value='$type[$i]'>$type[$i]</option>";
}
?>

</select><br/>
Battery Log (.csv): <input type="file" name="battLog" id="battLog" /><br />
Locks Log (.csv): <input type="file" name="locksLog" id="locksLog" /><br />
<input type="submit" name="submit" value="Submit" />
</form>

</body>
</html>
